package com.mengma.ec.dao;

import com.mengma.ec.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository("userMapper")
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int checkUserName(String userName);

    User loginByUserNameAndPd(@Param("username") String username, @Param("pwd") String md5Password);

    int checkUserEmail(String email);

    String findQuestionByUserName(String username);

    int forget_get_answer(@Param("username")String username, @Param("question")String question, @Param("answer")String answer);


    int reset_password(@Param("passwordOld") String passwordOld,@Param("passwordNew")  String passwordNew,@Param("username") String username);

    int updataPasswordByUserName(@Param("username") String username, @Param("password") String passwordNew);

    int updata_information(User user);
}